{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 1b. Calculate Pvsat for analyses from a csv file using default options\n", "\n", "This time, instead of creating a dataframe in a cell for the analysis, we'll read it in from a spreadsheet. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Python set-up\n", "You need to install VolFe once on your machine, if you haven't yet. Then we need to import a few Python packages (including VolFe). " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Install VolFe on your machine. Don't remove the # from this line!\n", "# pip install VolFe # Remove the first # in this line if you have not installed VolFe on your machine before.\n", "\n", "# import python packages\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import VolFe as vf" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Import data\n", "\n", "We'll use the examples_marianas_wT csv in files and use all the default options again. \n", "\n", "The data in this file are from Brounce et al. (2014) and Kelley & Cottrell (2012) with updated values for Fe3+/FeT from Cottrell et al. (2021) where available." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Read csv to define melt composition\n", "my_analyses = pd.read_csv(\"../files/example_marianas_wT.csv\") " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Run the calculation\n", "\n", "### Calculate only for the first row\n", "\n", "There are a few analyses in the csv. First, we will tell the function to stop after the first analysis by saying last_row=1:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | sample | \n", "T_C | \n", "P_bar | \n", "SiO2_wtpc | \n", "TiO2_wtpc | \n", "Al2O3_wtpc | \n", "FeOT_wtpc | \n", "MnO_wtpc | \n", "MgO_wtpc | \n", "CaO_wtpc | \n", "... | \n", "KHOSg opt | \n", "KOSg opt | \n", "KOSg2 opt | \n", "KCOg opt | \n", "KCOHg opt | \n", "KOCSg opt | \n", "KCOs opt | \n", "carbonylsulfide opt | \n", "density opt | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "TN273-01D-01-01 | \n", "1200 | \n", "327.89713 | \n", "57.03956 | \n", "1.661735 | \n", "15.536223 | \n", "9.479899 | \n", "0.240251 | \n", "2.963094 | \n", "6.496784 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:16:47.730099 | \n", "
1 rows × 173 columns
\n", "| \n", " | sample | \n", "T_C | \n", "P_bar | \n", "SiO2_wtpc | \n", "TiO2_wtpc | \n", "Al2O3_wtpc | \n", "FeOT_wtpc | \n", "MnO_wtpc | \n", "MgO_wtpc | \n", "CaO_wtpc | \n", "... | \n", "KHOSg opt | \n", "KOSg opt | \n", "KOSg2 opt | \n", "KCOg opt | \n", "KCOHg opt | \n", "KOCSg opt | \n", "KCOs opt | \n", "carbonylsulfide opt | \n", "density opt | \n", "Date | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Agr07-4 | \n", "1200 | \n", "3021.75825 | \n", "45.451495 | \n", "0.650021 | \n", "17.270568 | \n", "10.190335 | \n", "0.230008 | \n", "5.540182 | \n", "12.320405 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:29.203778 | \n", "
| 0 | \n", "Agr07-9 | \n", "1200 | \n", "2243.897993 | \n", "48.25551 | \n", "0.760875 | \n", "17.309912 | \n", "9.150526 | \n", "0.180207 | \n", "4.825551 | \n", "12.093912 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:30.113102 | \n", "
| 0 | \n", "Agr07-15A | \n", "1200 | \n", "2011.082314 | \n", "47.769532 | \n", "0.810841 | \n", "16.747365 | \n", "10.681075 | \n", "0.220228 | \n", "5.665875 | \n", "11.34176 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:31.371052 | \n", "
| 0 | \n", "Agr07-15B | \n", "1200 | \n", "1512.829185 | \n", "48.020961 | \n", "0.860914 | \n", "16.847879 | \n", "10.43107 | \n", "0.190202 | \n", "5.555896 | \n", "11.342036 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:32.264473 | \n", "
| 0 | \n", "Agr04-13 | \n", "1200 | \n", "1795.635387 | \n", "51.009753 | \n", "0.801095 | \n", "16.742895 | \n", "8.842091 | \n", "0.200274 | \n", "4.866655 | \n", "10.173912 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:33.057059 | \n", "
| 0 | \n", "Agr04-14 | \n", "1200 | \n", "837.821294 | \n", "48.748373 | \n", "0.780775 | \n", "18.618475 | \n", "9.319247 | \n", "0.170169 | \n", "5.355314 | \n", "12.071979 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:33.740649 | \n", "
| 0 | \n", "AGR19-02-4 | \n", "1200 | \n", "2187.349272 | \n", "47.941949 | \n", "0.655476 | \n", "17.667136 | \n", "9.729727 | \n", "0.266287 | \n", "4.700994 | \n", "13.099285 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:34.500829 | \n", "
| 0 | \n", "AGR19-02-7 | \n", "1200 | \n", "1051.384389 | \n", "47.730139 | \n", "0.852868 | \n", "18.570182 | \n", "9.472925 | \n", "0.172604 | \n", "4.406484 | \n", "12.853936 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:35.213903 | \n", "
| 0 | \n", "AGR19-02-10 | \n", "1200 | \n", "2658.556396 | \n", "47.019198 | \n", "0.74585 | \n", "18.196695 | \n", "9.185193 | \n", "0.153257 | \n", "4.689659 | \n", "12.914443 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:36.148222 | \n", "
| 0 | \n", "AGR19-02-11 | \n", "1200 | \n", "1922.602884 | \n", "47.917169 | \n", "0.777976 | \n", "18.077701 | \n", "9.315237 | \n", "0.214967 | \n", "4.729274 | \n", "12.713763 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:36.944427 | \n", "
| 0 | \n", "AGR19-02-12B | \n", "1200 | \n", "1739.191323 | \n", "47.435232 | \n", "0.745805 | \n", "18.236461 | \n", "10.400402 | \n", "0.23498 | \n", "4.137684 | \n", "12.883013 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:37.562294 | \n", "
| 0 | \n", "AGR19-02-13 | \n", "1200 | \n", "1287.550005 | \n", "48.921079 | \n", "0.816883 | \n", "17.185175 | \n", "10.517368 | \n", "0.234854 | \n", "4.349902 | \n", "11.507839 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:38.325082 | \n", "
| 0 | \n", "AGR19-02-14 | \n", "1200 | \n", "2082.780574 | \n", "47.47502 | \n", "0.694408 | \n", "17.901422 | \n", "10.038276 | \n", "0.183814 | \n", "5.351024 | \n", "11.907049 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:39.187433 | \n", "
| 0 | \n", "AGR19-02-15 | \n", "1200 | \n", "3106.640066 | \n", "46.734976 | \n", "0.618939 | \n", "17.888355 | \n", "9.588483 | \n", "0.213077 | \n", "4.535505 | \n", "13.697833 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:40.374486 | \n", "
| 0 | \n", "AGR19-02-16 | \n", "1200 | \n", "2643.620359 | \n", "46.272265 | \n", "0.66434 | \n", "17.32316 | \n", "10.740158 | \n", "0.221447 | \n", "5.395243 | \n", "12.149363 | \n", "... | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "ONeill22 | \n", "Ohmoto97 | \n", "Ohmoto97 | \n", "Moussallam19 | \n", "Holloway92 | \n", "COS | \n", "DensityX | \n", "2025-02-18 13:17:41.435848 | \n", "
15 rows × 173 columns
\n", "